import { ref } from 'vue'
export const useNotify = (el) => {
  const NotifyRef = ref(el)
  const config = {
    top: uni.getMenuButtonBoundingClientRect().top,
    duration: 1000 * 3,
  }
  
  const showNotify = (options) => {
    NotifyRef.value.show(Object.assign(config, options))
  }
  
  const closeNotify = () => NotifyRef.value.close()
  
  return {
    showNotify,
    closeNotify
  }
}